package top.chengdongqing.mishop.media.banner

import top.chengdongqing.mishop.entities.Banner
import java.io.Serializable

data class BannerVO(
    val id: Int,
    val src: String,
    val href: String,
    val target: String
) : Serializable {
    companion object {
        fun of(banner: Banner): BannerVO {
            return BannerVO(
                banner.id,
                banner.src,
                banner.href,
                banner.target
            )
        }

        fun of(banners: List<Banner>): List<BannerVO> {
            return banners.map { of(it) }
        }
    }
}
